<template>
  <div class="resource">
    <el-card shadow="hover">
      <div>
        <i class="el-icon-search" />
        <span>筛选搜索</span>
        <el-button
          style="margin-left:20px;"
          icon="el-icon-search"
          type="primary"
          size="mini"
          @click="search"
        >
          搜索
        </el-button>
        <el-button
          icon="el-icon-refresh-right"
          size="mini"
          plain
          @click="cancelData"
        >
          重置
        </el-button>
      </div>
        <el-form
          ref="params"
          :model="params"
          label-width="130px"
          size="mini"
          class="searchForm"
        >
      <el-row :gutter="20" style="margin-top: 20px">
          <el-col :span="6">
            <el-form-item label="订单编号:" prop="orderSn">
              <el-input
                v-model="params.orderSn"
                size="small"
                clearable
                @clear="search"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="订单状态:" prop="state">
              <el-select
                v-model="params.state"
                filterable
                placeholder="请选择"
                @change="search"
              >
                <el-option
                  v-for="item in stateOptions"
                  :key="item.id"
                  :label="item.title"
                  :value="item.id"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="证书名称:" prop="certificateName">
              <el-input
                v-model="params.certificateName"
                size="small"
                clearable
                @clear="search"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="咨询服务:" prop="state">
              <el-select
                v-model="params.consult"
                filterable
                placeholder="请选择"
                clearable
              >
                <el-option
                  v-for="item in consultList"
                  :key="item.id"
                  :label="item.title"
                  :value="item.id"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          </el-row>
          <el-row :gutter="20" style="margin-top: 20px">
          <el-col :span="6">
            <el-form-item label="电子出证日期:" prop="createTime">
              <el-date-picker
                v-model="params.edHisDate"
                type="date"
                placeholder="选择日期"
                @change="search"
                value-format="yyyy-MM-dd"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="6">
            <el-form-item label="纸质出证日期:" prop="createTime">
              <el-date-picker
                v-model="params.paperHisDate"
                type="date"
                placeholder="选择日期"
                @change="search"
                value-format="yyyy-MM-dd"
              >
              </el-date-picker>
            </el-form-item>
          </el-col> -->
          </el-row>
        </el-form>
      <!-- </el-row> -->
    </el-card>
          <!-- <el-col :span="6">
            <el-form-item label="接单老师:" prop="teacherName" v-if="!openFlag">
              <el-input
                v-model="params.teacherName"
                size="small"
                clearable
              ></el-input>
            </el-form-item>
          </el-col> -->
          <!-- <el-col :span="6">
            <el-form-item label="创建时间:" v-if="!openFlag" prop="createTime">
              <el-date-picker
                v-model="params.createTime"
                type="datetime"
                placeholder="选择日期时间"
                @change="createTime"
                value-format="yyyy-MM-dd HH:mm:ss"
              >
              </el-date-picker>
            </el-form-item>
          </el-col> -->
          <!-- <el-col :span="4" v-if="openFlag">
            <el-button
              icon="el-icon-folder-opened"
              type="primary"
              size="small"
              @click="openSearch"
              >展开</el-button
            >
          </el-col>
          <el-col :span="6" v-if="!openFlag">
            <el-button
              @click="openSearch"
              icon="el-icon-folder-opened"
              type="primary"
              size="small"
              >收起</el-button
            >
          </el-col> -->

    <div class="container">
      <div class="handle-box">
        <!-- <el-button
          size="small"
          type="primary"
          icon="el-icon-plus"
          @click="handleAdd"
          class="mr10"
          >新增</el-button
        > -->
        <!-- <el-button
          type="danger"
          icon="el-icon-delete"
          class="handle-del mr10"
          size="small"
          :disabled="multiple"
          @click="handleDelete"
          >批量删除</el-button
        > -->
      </div>

      <el-table
        max-height="550"
        v-loading="loading"
        :data="tableData"
        border
        class="table"
        ref="multipleTable"
        header-cell-class-name="table-header"
        @selection-change="handleSelectionChange"
      >
        <!-- <el-table-column
          type="selection"
          width="50"
          align="center"
        ></el-table-column> -->
        <!-- 二级菜单 -->
         <el-table-column type="expand">
            <template slot-scope="props">
              <h3>订单列表</h3>
              <el-table
                :data="props.row.certificateOrderList"
                border
                header-cell-style="color: #515a6e;background:#f8f8f9"
                style="width: 100%">
                <!-- <el-table-column
                    type="selection"
                    width="50"
                    align="center"
                  ></el-table-column> -->
                  <!--  -->
                  <el-table-column
          prop="orderSn"
          label="订单编号"
          align="center"
          min-width="200"
         
        ></el-table-column>
        <el-table-column
          prop="certificateName"
          label="证书名称"
          align="center"
          min-width="150"
          :show-overflow-tooltip="true"
        ></el-table-column>
        <el-table-column label="规格说明" align="center" min-width="180">
          <template slot-scope="scope">
            {{ scope.row.specName }}
          </template>
        </el-table-column>
        <el-table-column label="是否咨询" align="center" width="150">
          <template slot-scope="scope">
            {{status_consult(scope.row.consult)}}
          </template>
        </el-table-column>
        <el-table-column
          prop="dockingPeople"
          label="对接人"
          align="center"
          width="120"
        ></el-table-column>
        <el-table-column
          prop="dockingPhone"
          label="联系电话"
          align="center"
          width="150"
        ></el-table-column>
        <el-table-column prop="address" show-overflow-tooltip label="客户地址"></el-table-column>
        <el-table-column prop="actualAddress" show-overflow-tooltip label="办公地址"></el-table-column>
        <el-table-column prop="region" show-overflow-tooltip label="经营范围"></el-table-column>
        <el-table-column
          label="营业执照"
          min-width="150"
          align="center"
          :show-overflow-tooltip="true"
        >
          <template slot-scope="scope">
            <viewer >
              <img
                v-if="scope.row.businessLicense != null"
                class="study_pic"
                :src="showUrl + JSON.parse(scope.row.businessLicense)[0]"
                alt=""
              />
            </viewer>
          </template>
        </el-table-column>
        <el-table-column label="出证日期(电子)" align="center" width="155">
          <template slot-scope="scope">
            {{ formatT(scope.row.edHisDate) }}
          </template>
        </el-table-column>
        <!-- <el-table-column label="出证日期(纸质)" align="center" width="155">
          <template slot-scope="scope">
            {{ formatT(scope.row.paperHisDate) }}
          </template>
        </el-table-column> -->
        <el-table-column label="订单状态" align="center" width="150">
          <template slot-scope="scope">
            <span>{{ status(scope.row.state) }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column
          prop="price"
          label="证书金额"
          align="center"
          width="100"
        ></el-table-column> -->
        <el-table-column
          prop="remarks"
          label="备注说明"
          align="center"
          min-width="150"
          :show-overflow-tooltip="true"
        ></el-table-column>
        <el-table-column label="创建时间" align="center" min-width="160">
          <template slot-scope="scope">{{
            formatT(scope.row.createTime)
          }}</template>
        </el-table-column>
        <el-table-column label="操作" width="170" align="center" fixed="right">
          <template slot-scope="scope">
            <el-button
              type="text"
              @click="handlePass(scope.row)"
              v-if="scope.row.state == 1"
              >通过
            </el-button>
            <el-button
              type="text"
              @click="handleReturn(scope.row)"
              v-if="scope.row.state == 1"
              >拒绝
            </el-button>
            <el-button
              type="text"
              icon="el-icon-edit-outline"
              @click="handleEdit(scope.$index, scope.row)"
              >查看</el-button
            >
            <!-- <el-button
              type="danger"
              size="small"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              >删除</el-button
            > -->
          </template>
        </el-table-column>
               
          </el-table>
        </template>
        </el-table-column>
        <!-- <el-table-column
          prop="orderSn"
          label="订单编号"
          align="center"
          min-width="200"
         
        ></el-table-column> -->
        <!-- <el-table-column
          prop="certificateName"
          label="证书名称"
          align="center"
          min-width="150"
          :show-overflow-tooltip="true"
        ></el-table-column>
        <el-table-column label="规格说明" align="center" min-width="180">
          <template slot-scope="scope">
            {{ scope.row.specName }}
          </template>
        </el-table-column> -->
        <el-table-column label="业务人员" prop="sysName" width="80" align="center"></el-table-column>
        <el-table-column label="是否咨询" align="center" width="150">
          <template slot-scope="scope">
            {{status_consult(scope.row.consult)}}
          </template>
        </el-table-column>
        <el-table-column
          prop="dockingPeople"
          label="对接人"
          align="center"
          width="120"
        ></el-table-column>
        <el-table-column
          prop="dockingPhone"
          label="联系电话"
          align="center"
          width="150"
        ></el-table-column>
        <el-table-column
          label="营业执照"
          min-width="150"
          align="center"
          :show-overflow-tooltip="true"
        >
          <template slot-scope="scope">
            <viewer >
              <img
                v-if="scope.row.businessLicense != null"
                class="study_pic"
                :src="showUrl + JSON.parse(scope.row.businessLicense)[0]"
                alt=""
              />
            </viewer>
          </template>
        </el-table-column>
        <el-table-column label="出证日期(电子)" align="center" width="155">
          <template slot-scope="scope">
            {{ formatT(scope.row.edHisDate) }}
          </template>
        </el-table-column>
        <!-- <el-table-column label="出证日期(纸质)" align="center" width="155">
          <template slot-scope="scope">
            {{ formatT(scope.row.paperHisDate) }}
          </template>
        </el-table-column> -->
        <el-table-column label="订单状态" align="center" width="150">
          <template slot-scope="scope">
            <span>{{ status(scope.row.state) }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column
          prop="price"
          label="证书金额"
          align="center"
          width="100"
        ></el-table-column> -->
        <el-table-column
          prop="remarks"
          label="备注说明"
          align="center"
          min-width="150"
          :show-overflow-tooltip="true"
        ></el-table-column>
        <el-table-column label="创建时间" align="center" min-width="160">
          <template slot-scope="scope">{{
            formatT(scope.row.createTime)
          }}</template>
        </el-table-column>
        <el-table-column label="操作" width="220" align="center" fixed="right">
          <template slot-scope="scope">
            <el-button
              type="text"
              @click="handlePass1(scope.row)"
              v-if="scope.row.state == 1"
              >通过
            </el-button>
            <el-button
              type="text"
              @click="handleReturn(scope.row)"
              v-if="scope.row.state == 1"
              >拒绝
            </el-button>
            <!-- <el-button
              type="text"
              icon="el-icon-edit-outline"
              @click="handleEdit(scope.$index, scope.row)"
              >查看</el-button
            > -->
            <!-- <el-button
              type="danger"
              size="small"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              >删除</el-button
            > -->
          </template>
        </el-table-column>
      </el-table>
      <!-- </el-card> -->
      <div class="pagination">
        <pagination
          v-show="pageTotal > 0"
          :total="pageTotal"
          :page.sync="params.pageNum"
          :limit.sync="params.pageSize"
          @pagination="getData00"
        />
      </div>
    </div>

    <!-- 查看信息框 -->
    <el-dialog :title="title666" :visible.sync="dialogVisible" width="800px">
      <el-form
        ref="formData"
        :model="formData"
        label-width="130px"
        size="small"
        class="form-box"
      >
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="订单编号:" prop="orderSn">
              <el-input
                v-model="formData.orderSn"
                :disabled="isedit"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="证书名称:" prop="certificateName">
              <el-input
                v-model="formData.certificateName"
                :disabled="isedit"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="规格:" prop="specName">
              <span>{{ formData.specName }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="订单状态:" prop="state">
              <span style="font-weight: bold; color: #409eff">{{
                status(formData.state)
              }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="formData.state == 1">
            <el-form-item label="证书金额:" prop="price">
              <el-input v-model="formData.price" disabled></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="公司对接人:" prop="dockingPeople">
              <el-input
                v-model="formData.dockingPeople"
                :disabled="isedit"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="对接人号码:" prop="dockingPhone">
              <el-input
                v-model="formData.dockingPhone"
                :disabled="isedit"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="咨询费用" v-if="formData.consult == 1">
              <el-input v-model="zixunPrice" disabled>
                <span slot="append" class="blue2" @click="payMoney"
                  >点击付款</span
                >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="20">
            <el-form-item label="营业执照:" prop="businessLicense">
              <div
                v-for="(item, index) in formData.businessLicense"
                :key="index"
                class="avatar6"
              >
                <viewer>
                <img :src="showUrl + item" alt="" width="200" height="180"/>
                </viewer>
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="电子证书出证时间" prop="edHisDate">
              <el-date-picker
                v-model="formData.edHisDate"
                type="date"
                placeholder="选择出证日期"
                value-format="yyyy-MM-dd"
                disabled
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="12">
            <el-form-item label="纸质证书出证时间" prop="paperHisDate">
              <el-date-picker
                v-model="formData.paperHisDate"
                type="date"
                placeholder="选择出证日期"
                value-format="yyyy-MM-dd"
                disabled
              >
              </el-date-picker>
            </el-form-item>
          </el-col> -->
          <!-- <el-col :span="12">
            <el-form-item label="支付方式" prop="payType">
              <span class="green" v-if="formData.payType == 1">微信支付</span>
              <span class="blue2" v-if="formData.payType == 2">支付宝支付</span>
              <span class="yellow" v-if="formData.payType == 3">零钱支付</span>
            </el-form-item>
          </el-col> -->
          <!-- <el-col :span="12">
            <el-form-item label="物流单号" prop="wuLiu">
              <el-input v-model="formData.wuLiu" disabled></el-input>
            </el-form-item>
          </el-col> -->
          <!-- <el-col :span="12">
            <el-form-item label="咨询公司" prop="companyName">
              <el-input v-model="formData.companyName" disabled></el-input>
            </el-form-item>
          </el-col> -->
          <!-- <el-col :span="12">
            <el-form-item label="支付时间" prop="payTime">
              <el-input v-model="formData.payTime" disabled></el-input>
            </el-form-item>
          </el-col> -->
          <!-- <el-col :span="24">
            <el-form-item label="备注">
              <el-input
                :rows="6"
                type="textarea"
                v-model="formData.remarks"
              ></el-input>
            </el-form-item>
          </el-col> -->
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer" v-if="formData.state == 9">
        <el-button @click="dialogVisible = false" size="mini">取消</el-button>
        <el-button @click="submitForm()" type="primary" size="mini"
          >确定</el-button
        >
      </span>
    </el-dialog>

    <!-- 审批弹框 -->
    <el-dialog title="审批" :visible.sync="checkVisible" width="40%">
      <el-form
        ref="checkForm"
        :model="checkForm"
        label-width="120px"
        :rules="checkRules"
      >
        <el-form-item label="审批驳回原因：" prop="remarks">
          <el-input v-model="checkForm.remarks"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="cancelCheck">取 消</el-button>
        <el-button type="primary" @click="sumitCheck">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import {
  orderReceive_List,
  updateOrder,
  updateProcess1,
  updateProcess
} from "@/api/order/orderReceiveAds";
import { certificateList } from "@/api/certificate/certificateAds";
import { getToken } from "@/utils/auth";
export default {
  components: {},
  props: [],
  data() {
    return {
      cateList2: [],
      // 非多个禁用
      multiple: true,
      //删除
      ids: [],
      headers: { Authorization: "Bearer " + getToken() },
      upImage: process.env.VUE_APP_BASE_API,
      title666: "",
      rules2: {
        phone: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
        companyName: [
          { required: true, message: "请输入公司名称", trigger: "blur" }
        ],
        linkman: [
          { required: true, message: "请输入联系人名称", trigger: "blur" }
        ],
        businessLicense: [
          { required: true, message: "请上传图片", trigger: "blur" }
        ]
      },
      input: "",
      openFlag: true,
      loading: true,
      //数据
      tableData: [],
      params: {
        pageNum: 1,
        pageSize: 10,
        state: 1
      },
      consultList: [
        { id: 1,title: '需咨询' },
        { id: 2,title: '不咨询' }
      ],
      stateOptions: [
        {
          id: 1,
          title: "待审批"
        },
        {
          id: 3,
          title: "审批通过"
        },
        {
          id: 2,
          title: "审批驳回"
        }
      ],
      pageTotal: 0,
      dialogVisible: false, // 是否展示编辑页面
      // 新增/编辑数据
      formData: {
        businessLicense: ""
      },
      customer: {
        customerId: ""
      },
      paramsFlag: 0,
      editFlags: false,

      checkVisible: false,
      checkForm: {
        remarks: ""
      },
      checkRules: {
        remarks: [
          { required: true, message: "审批驳回原因不能为空", trigger: "blur" }
        ]
      },
      zixunPrice: "",
      isedit: true
    };
  },
  computed: {},
  created() {
    this.getData00();
  },
  mounted() {
    this.getDicts("money_zixun").then(response => {
      this.zixunPrice = response.data[0].dictValue;
    });
  },
  watch: {},
  methods: {
    // 触发流程
    // process(row) {
    //   updateProcess1({
    //     orderId: row.id,
    //     flowSerial: 2,
    //     context:'',
    //     accessory: '',
    //     finish: 1,
    //     flowList:[{
    //       orderId: id,
    //       flowSerial: flowSerial,
    //       context: context,
    //       accessory: accessory,
    //       finish: 1,
    //     }],
    //     // flowList:row.certificateOrderList.map(item => {
    //     //   return{
    //     //     orderId:item.id,
    //     //     flowSerial: 2,
    //     //     context: '',
    //     //     accessory: '',
    //     //     finish: 1,
    //     //   }
    //     // })
    //   }).then(res => {
    //     if (res.code == 200) {
    //       this.$message.success("操作成功");
    //       this.getData00();
    //     }else{
    //       this.$message.error("操作失败");
    //     }
    //   });
    // },
    process(id,flowSerial,context,accessory) {
      updateProcess({
        orderId: id,
        flowSerial: flowSerial,
        context: context,
        accessory: accessory,
        finish: 1,
        flowList:[{
          orderId: id,
          flowSerial: flowSerial,
          context: context,
          accessory: accessory,
          finish: 1,
        }],
      }).then(res => {
        if (res.code == 200) {
          this.$message.success("操作成功");
          this.getData00();
        }
      });
    },
    process1(row) {
      updateProcess({
        orderId: row.id,
        flowSerial: 2,
        context: '',
        accessory: '',
        finish: 1,
        flowList:row.certificateOrderList.map(item => {
          return{
            orderId:item.id,
            flowSerial: 2,
            context: '',
            accessory: '',
            finish: 1,
          }
        })
      }).then(res => {
        if (res.code == 200) {
          this.$message.success("操作成功");
          this.getData00();
        }
      });
    },
    payMoney() {
      console.log("此处增加微信网页支付");
    },
    //获取数据
    getData00() {
      orderReceive_List(this.params).then(res => {
        if (res.code == 200) {
          this.tableData = res.rows;
          this.pageTotal = res.total;
          this.loading = false;
        }
      });
    },
    // 审批拒绝
    handleReturn(row) {
      this.checkForm = row;
      this.checkVisible = true;
      this.checkForm.remarks = "";
    },
    cancelCheck() {
      this.checkVisible = false;
      this.checkForm.remarks = "";
    },
    sumitCheck() {
      this.$refs["checkForm"].validate(valid => {
        if (valid) {
          this.checkForm.state = 2;
          updateOrder(this.checkForm).then(res => {
            if (res.code == 200) {
              this.$message.success("审批拒绝成功");
              this.getData00();
              this.checkVisible = false;
            } else {
              this.$message.error("拒绝失败");
              this.checkVisible = false;
            }
          });
        }
      });
    },
    // 审批通过
    handlePass(row) {
      let query = row;
      console.log(query);
      this.$confirm("确认审批通过?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        query.state = 3;
        updateOrder(query).then(res => {
          if (res.code == 200) {
            // this.process(row);
            this.process(row.id,2,'','');
            this.getData00();
          }
        });
      });
    },
    
    handlePass1(row) {
      let query = row;
      this.$confirm("确认审批通过?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        query.state = 3;
        updateOrder(query).then(res => {
          if (res.code == 200) {
            console.log('我在这')
            this.process1(query);
            this.getData00();
          }
        });
      });
    },
    // 查询证书类别列表
    getCateList() {
      this.loading = true;
      certificateList({
        pageNum: 1,
        pageSize: 9999
      }).then(res => {
        this.loading = false;
        if (res.code == 200) {
          this.cateList2 = res.rows;
          // this.cateList = res.rows;
        } else {
          this.msgError("查询失败！");
        }
      });
    },
    querySearch(queryString, cb) {
      console.log(queryString, this.cateList2);
      var restaurants = this.cateList2;
      var results = queryString
        ? restaurants.filter(this.createFilter(queryString))
        : restaurants;
      // 调用 callback 返回建议列表的数据
      cb(results);
    },
    createFilter(queryString) {
      return restaurant => {
        return (
          restaurant.categoryName
            .toLowerCase()
            .indexOf(queryString.toLowerCase()) === 0
        );
      };
    },
    // 键值配对
    status(val) {
      var str = this.stateOptions.find(function(item) {
        return item.id == val;
      });
      if (str) return str.title;
    },
    status_consult(val){
      let str = this.consultList.find(function(item){
        return item.id == val;
      })
      if(str) return str.title;
    },
    // 键值配对
    status2(val) {
      var str = this.cateList2.find(function(item) {
        return item.id == val;
      });
      if (str) return str.categoryName;
    },
    handleAvatarSuccess(res, file) {
      if (res.code == 200) {
        this.formData.businessLicense = res.url;
        console.log(this.formData.businessLicense);
        this.$message.success(`上传成功`);
      }
    },
    // 新增修改的方法
    submitForm() {
      this.$refs["formData"].validate(valid => {
        if (valid) {
          this.formData.state = 2;
          updateOrder(this.formData).then(res => {
            if (res.code == 200) {
              this.$message.success("提交成功");
              this.getData00();
              this.dialogVisible = false;
            }
          });
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    // 打开搜索
    openSearch() {
      this.openFlag = !this.openFlag;
    },
    // 重置搜索框
    cancelData() {
      this.params = {
        pageNum: 1,
        pageSize: 10,
        state: 1
      }
      this.resetForm("params");
      this.getData00();
    },
    handleAdd() {
      this.formData = {
        businessLicense: ""
      };
      this.dialogVisible = true;
      this.title666 = "新增";
    },
    handleEdit(index, row) {
      let rowCopy = JSON.parse(JSON.stringify(row));
      this.formData = rowCopy;
      this.formData.businessLicense = JSON.parse(row.businessLicense);
      this.dialogVisible = true;
      this.title666 = "查看";
      this.isedit = true;
    },
    handleEdit1(row) {
      let rowCopy = JSON.parse(JSON.stringify(row));
      this.formData = rowCopy;
      this.formData.businessLicense = JSON.parse(row.businessLicense);
      this.dialogVisible = true;
      this.title666 = "修改订单信息";
      this.isedit = false;
    },
    handleExamine(index, row) {
      this.formData = row;
      this.dialogVisible = true;
      this.title666 = "审核";
    },
    closeDialog() {
      this.dialogVisible = false;
    },
    // 删除操作
    handleSelectionChange(val) {
      this.ids = val.map(item => item.id);
      this.single = val.length != 1;
      this.multiple = !val.length;
    },
    // 批量删除
    handleDelete(row) {
      const id = row.id || this.ids;
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function() {
          return company_delete(id);
        })
        .then(() => {
          this.getData00();
          this.msgSuccess("删除成功");
        })
        .catch(function() {});
    },

    // 触发搜索按钮
    search() {
      this.$set(this.params, "pageNum", 1);
      this.paramsFlag = 0;
      this.getData00();
    },
    // 分页导航
    handlePageChange(val) {
      this.$set(this.params, "pageNum", val);
      this.getData00();
    }
  }
};
</script>

<style scoped>
.resource {
  padding: 20px 30px;
}
.container {
  margin-top: 20px;
}
.handle-box {
  margin-bottom: 10px;
}

.table {
  width: 100%;
  font-size: 14px;
}
.red {
  color: #ff0000;
}
.yellow {
  color: #f57506;
}
.green {
  color: green;
  cursor: pointer;
}
.blue2 {
  color: #409eff;
}
.blue {
  color: #409eff;
  cursor: pointer;
  text-decoration: underline;
}
.mr10 {
  margin-right: 10px;
}

.searchForm .el-form-item--mini.el-form-item,
.searchForm .el-form-item--small.el-form-item {
  margin-bottom: 1px;
}
.study_pic {
  display: block;
  width: 100px;
  height: 85px;
  margin: auto;
  /* border-radius: 50%; */
}
.avatar {
  display: inline-block;
  margin-right: 10px;
}
.avatar img {
  width: 200px;
}
.avatar6 {
  display: inline-block;
  margin-right: 10px;
  position: relative;
}
.avatar6 img {
  width: 200px;
}
</style>
